package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import po.Sight;
import service.SightService;

import java.util.List;

/**
 * Created by apple on 2017/11/2.
 */

@Controller
public class SightController {

    @Autowired
    private SightService sightService;

    @RequestMapping(value = "/addSightInfo.do", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public void addSight(Sight sight) {
        sightService.createSightInfo(sight);
    }

    @RequestMapping(value = "/showSightInfo.do", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public Sight showSightInfoById(Integer id) {
        return sightService.selectSightBySightId(id);
    }

    /*@RequestMapping
    @ResponseBody
    public */
}
